home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / PREFRESH.C < prev    next >
Text File  |  1992-11-21  |  3KB  |  77 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef prefresh
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_prefresh = "$Header: c:/curses/portable/RCS/prefresh.c%v 2.0 1992/11/15 03:29:08 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   prefresh()   - refresh pad
  15.  
  16.   X/Open Description:
  17.        The prefresh routine copies the specified pad to the physical
  18.        terminal screen.  It takes account of what is already
  19.        displayed on the screen to optimize cursor movement.
  20.  
  21.        The pnoutrefresh routine copies the named pad to the virtual
  22.        screen. It then compares the virtual screen with the physical
  23.        screen and performs the actual update.
  24.  
  25.        These routines are analogous to the routines wrefresh and
  26.        wnoutrefresh except that pads, instead of windows, are
  27.        involved.  Additional parameters are also needed to indicate
  28.        what part of the pad and screen are involved. The upper left
  29.        corner of the part of the pad to be displayed is specified by
  30.        py and px.  The coordinates sy1, sx1, sy2, and sx2 specify the
  31.        edges of the screen rectangle that will contain the selected
  32.        part of the pad.
  33.  
  34.        The lower right corner of the pad rectangle to be displayed is
  35.        calculated from the screen co-ordinates.  This ensures that
  36.        the screen rectangle and the pad rectangle are the same size.
  37.  
  38.        Both rectangles must be entirely contained within their
  39.        respective structures.
  40.  
  41.   PDCurses Description:
  42.        Contrary to the statements above, the pnoutrefresh() routine
  43.        will not perform an update to the physical screen.  This task
  44.        is performed by doupdate().
  45.  
  46.   X/Open Return Value:
  47.        The prefresh() function returns OK on success and ERR on error.
  48.  
  49.   PDCurses Errors:
  50.        It is an error to pass a null WINDOW* pointer.
  51.  
  52.   Portability:
  53.        PDCurses        int prefresh( WINDOW* win, int py, int px,
  54.                                                int sy1, int sx1,
  55.                                                int sy2, int sx2 );
  56.        X/Open Dec '88  int prefresh( WINDOW* win, int py, int px,
  57.                                                int sy1, int sx1,
  58.                                                int sy2, int sx2 );
  59.        BSD Curses      int prefresh( WINDOW* win, int pminrow, int pmincol,
  60.                                                int sminrow, int smincol,
  61.                                                int smaxrow, int smaxcol );
  62.        SYS V Curses    int prefresh( WINDOW* win, int py, int px,
  63.                                                int sy1, int sx1,
  64.                                                int sy2, int sx2 );
  65.  
  66. **man-end**********************************************************************/
  67.  
  68. int    prefresh(WINDOW* win,int py,int px,int sy1,int sx1,int sy2,int sx2)
  69. {
  70.        if (win == (WINDOW *)NULL)
  71.                return( ERR );
  72.  
  73.        pnoutrefresh(win, py, px, sy1, sx1, sy2, sx2);
  74.        doupdate();
  75.        return( OK );
  76. }
  77.